package com.robert.textdemo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.EditText;


public class MainActivity extends AppCompatActivity {

    private static final String TAG = MainActivity.class.getSimpleName();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//        ImageView iv = findViewById(R.id.iv);
//        Uri parse = Uri.parse("" +
//                "pD+BB0MvdNstbVFbesW0S6FAL2GBXixQLAX9DxIiRkCBBAQlBkxEoxKj0WhjtcgTvPhnHB9W1nW3" +
//                "nZ3ZS2mIX/bhzMyZb86enXPmsi0QQvAfeDijOWNppENW504yq4A5nfNLK62WkAIqhYAYKBoTOGoQ" +
//                "whkqL6szPhTEZFOM4FhJD1osZynGeLdXWmm7bhXVBIZdupqhFTRz1rRpSisqzVFyeTjBFrar4VHl" +
//                "rM4Jm7AYzQyqYVOMdPxqYwZqgaduNUz1GtaeHejBfAqdJYXBZD3Y/6qeR2br0J2P83LYMaJ4GIam" +
//                "GJqaCTMMTU15Y6TdR8fMiocGAGjiKQDqbx3iBTNRPLdN99VritgsEZtFKnNIsf2c4C2EiUbEAeVx" +
//                "8HK/m1bJ9tdZHr+jvhoKjlAHolXqHWmNCIZRG6JVJ0y01di++EJOYVHVauhisTar6JnVtAiwPaKa" +
//                "BiV4hqZ4eadcEbVSN4qVF7OYVNcy3e+XdjWzjAhafYegy80JQ54RUZOuMyvic2vIVhNGp5ETdDzu" +
//                "FOx5SJizMmPtCMIkyyizJB7sRCsgTDKFBniZ4NYhagoTzdm5z/cJZzlYnP8mLM5kU8Li2so2KSGH" +
//                "xy8/IFqFKUKK6u4mLzciZ3HWcKlKKDcD0MlUBO3vs6Tg3cTQ1OVzF5vNU/j2nNWVnQffZcDlJu2L" +
//                "sAQAcD6zDABYH2ytqdZvjz39soVgIHoXAmehYxsTTz6+k9UZzmRXlhZlLRHGdRIsc00ir4k81e4f" +
//                "/v56BSj96rg5iyi2dYX0PYU1yc0jrrLeXBN2kaLeq+WcNxc+PcDaOvAra5Psv4VmWHoDIpMCBQOE" +
//                "MLFxmNg4VECIgHwYRm+nEC4/EeyUK9xyAQC4JLHt1dwPcDyzMCeaEGzOurpQ+5bin9XQ2tsnamZo" +
//                "6lf5p06eKjgVJns+7oRpqybWB1u5J7l5xD1o5oSZvXDlHgCgy1jjHkkmZxHFdqRr/PnefE19M+ut" +
//                "rr5FG4oJdM6SBecvfqL1xOjtrTIAoCtW3NuanXy0PzdqqtuZD8jJtPxfLFFs5wp/7lIm+8guv9QA" +
//                "cX4KR+veqeGg8LCKViA7G8omwo5sEYcnZ1f1X++k7nzIjjvNc1hBbGWmKN/dyhtdRm3MN4EQ+iMh" +
//                "YTFtDyimupVyHJM0LvwhH4YOs3LTG4x81iiqKdl9jRn6N67ladRwWruhAAAAAElFTkSuQmCC");
//        iv.setImageURI(parse);
        EditText editText = findViewById(R.id.et);
        editText.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                Log.d(TAG, "onTextChanged: content: " + s + ", count: " + count);
            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });
    }

    public void show(View view) {
        FirstDialog firstDialog = new FirstDialog(this);
        firstDialog.show();
    }

    public void radio(View view) {
        startActivity(new Intent(this, RadioActivity.class));
    }
}
